$def with ()

$var title: $_(u'SIP Run-Once')
$var page: runonce
$code:
	snames = gv.snames
	
<script>
    // Initialize behaviors
    jQuery(document).ready(function(){    	
        jQuery("button#cRunNow").click(function(){
            var comm="/cr?&t=[";
            var sid, strmm, strss, mm, ss, matchfound=0;
            for (sid = 0; sid < nbrd * 8; sid ++) {
                if (sid + 1 == mas) {
                    comm += "0,";
                    continue;
                }
                strmm = jQuery("input[name='mm" + sid + "']").val();
                strss = jQuery("input[name='ss" + sid + "']").val();
                mm = (strmm=="" || strmm==undefined ? 0 : parseInt(strmm));
                ss = (strss=="" || strss==undefined ? 0 : parseInt(strss));
                if (!(mm >= 0 && ss >= 0 && ss < 60)) {
                    alert($:{json.dumps(_('Timer values wrong: '), ensure_ascii=False)} + strmm + ":" + strss);
                    return;
                }
                if (mm * 60 + ss > 0) {
                    matchfound = 1;
                }
                comm += (mm * 60 + ss) + ",";
            }
            comm = comm.slice(0, -1) + "]";
            if (!matchfound) {
                alert($:{json.dumps(_('No station is scheduled to run'), ensure_ascii=False)});
                return;
            }
            window.location = comm;
        });

        jQuery("button#cResetTime").click(function(){
            jQuery("input[type='number']").val(0);
        });

        jQuery("button#cCancel").click(function(){
            window.location = "/";
        });

    });
</script>

<div id="runonce">
    <div class="title">$_('Run Once Program')</div>
    <form name="rf" action="/cr" method="get">
        <table class="stationList">
            $for bid in range(gv.sd['nbrd']):
                $for s in range(8):
                    $ sid = bid * 8 + s
                    $ show = (gv.sd['show'][bid]>>s)&1
                    $if show == 1 and sid+1 != gv.sd['mas']:
                        <tr>
                            <td class='station_name'>${snames[sid]}</td>
                            <td class=timeInput>
                                <label class="timeInput"><input type="number" max="999" value="0" name="mm${sid}">:</label>
                                <label class="timeInput"><input type="number" max="99" value="0" name="ss${sid}">(mm:ss)</label>
                            </td>
                        </tr>
        </table>
    </form>
</div>


<div class="controls">
    <button id="cRunNow" class="submit"><b>$_('Run Now')</b></button>
    <button id="cResetTime" class="refresh">$_('Reset Time')</button>
    <button id="cCancel" class="cancel danger">$_('Cancel')</button>
</div>
